package animationGame;

public class EquilateralTriangle extends GeometricObject{
	public EquilateralTriangle(double l, Vertex v){
		super(l,Math.sqrt(l*l-l*l/4),v);
	}
	
	public EquilateralTriangle(double l){
		super(l,Math.sqrt(l*l-l*l/4));
	}
	
	public @Override double circumference(){
		return width*3;
	}
	
	public @Override double area(){
		return width*height/2;
	}
	
	public @Override String toString(){
		return "EquilateralTriangle("+super.toString()+")";
	}
	
	public @Override boolean equals(Object that){
		return (that instanceof EquilateralTriangle) && super.equals(that);
	}
}
